using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Runtime.ConstrainedExecution;
using Marin.Entities;

namespace Marin.Repository.Mapping
{
    public class IngresoMap : EntityTypeConfiguration<Ingreso>
    {
        public IngresoMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            this.Property(p => p.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(p => p.Total)
                .HasPrecision(9, 2);

            // Properties
            // Table & Column Mappings
            this.ToTable("Ingresos");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Fecha).HasColumnName("Fecha");
            this.Property(t => t.Total).HasColumnName("Total");
            this.Property(t => t.Saldo).HasColumnName("Saldo");
        }
    }
}
